<!--
 * @Author: xuhy
 * @Date: 2022-04-21 14:46:57
 * @LastEditTime: 2022-04-21 15:08:32
 * @LastEditors: Please set LastEditors
 * @Description: 商品分类
 * @FilePath: \vue_shop\src\components\goods\GoodsCate.vue
-->
<template>
  <div>
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item><a href="/">商品管理</a></el-breadcrumb-item>
      <el-breadcrumb-item>商品分类</el-breadcrumb-item>
    </el-breadcrumb>
    <!-- 卡片视图区域 -->
    <el-card>
      <!-- 添加分类按钮区域 -->
      <el-row>
        <el-col>
          <el-button type="primary" @click="addRoleDialogVisible = true">
            添加分类
          </el-button>
        </el-col>
      </el-row>

      <!-- 表格 -->

      <!-- 分页区域 -->
    </el-card>
  </div>
</template>
<script>
export default {
  data() {
    return {
      // 查询条件
      queryInfo: {
        type: 3,
        pagenum: 1,
        pagesize: 5
      },
      // 商品分类的数据列表，默认为空
      cateList: []
    }
  },
  created() {
    this.getCateList()
  },
  methods: {
    // 获取商品分类数据
    async getCateList() {
      const { data: res } = await this.$http.get('categories', {
        params: this.queryInfo
      })
      if (res.meta.status !== 200) {
        return this.$message.error('获取商品分类失败了！')
      }
      console.log(res.data)
      // this.cateList = res.
    }
  }
}
</script>
<style lang="less" scoped></style>
